FROM maven:3.6.0-jdk-11-slim as build

WORKDIR /app

COPY src /app/src

COPY pom.xml /app

RUN mvn -f /app/pom.xml clean package

FROM openjdk:11-jre-slim

WORKDIR /app

COPY --from=build /app/target/serverless-demo-1.0.jar .

ENTRYPOINT ["java","-jar","/app/serverless-demo-1.0.jar"]

EXPOSE 80